{% extends "layout/immersive.html" %}
{% block content %}
<div class="row"><div class="columns">
    <div class="immersive--content immersive--center">
        <div class="row"><div class="columns">
            <h1>{{ _('Login with Telegram') }}</h1>
        </div></div>
    </div>
</div></div>
<div class="row"><div class="columns" id="telegram-login" style="text-align: center;">
    <script async src="https://telegram.org/js/telegram-widget.js?22"
        data-telegram-login="{{ botLogin }}" data-size="large" data-onauth="onTelegramAuth(user)"
        data-request-access="write"></script>
    <script type="text/javascript">
        function onTelegramAuth(user) {
            window.location.href = '/oauth/telegram/callback?payload=' + encodeURIComponent(JSON.stringify(user));
        }
    </script>
</div></div>
{% endblock %}